<?php

/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use johnitvn\ajaxcrud\CrudAsset;
use frontend\assets\AppAsset;
use yii\bootstrap\Modal;
use yii\widgets\LinkPager;

//$this->registerJsFile('/js/yanbing/jquery.poptrox.min.js', ['depends' => 'yii\web\YiiAsset']);
//$this->registerJsFile('/js/yanbing/skel.min.js', ['depends' => 'yii\web\YiiAsset']);
//$this->registerJsFile('/js/yanbing/init.js', ['depends' => 'yii\web\YiiAsset']);
$this->title = "膜结构|膜结构车棚|张拉膜结构|膜结构施工";
CrudAsset::register($this);
?>
<!-- Intro -->
<section id="intro" class="main style1 dark fullscreen">
    <div class="content container small">
        <header>
            <h2></h2>
        </header>
        <p>如需订购请联系我们</p>
        <footer>
            <a href="#one" class="button style2 down">More</a>
        </footer>
    </div>
</section>
<div class="copyrights">Collect from <a href="" >膜结构</a></div>

<!-- One -->
<section id="one" class="main style2 right dark fullscreen">
    <div class="content box style2">
        <header>
            <h2></h2>
        </header>
        <p>如需订购请联系我们</p>
    </div>
    <a href="#two" class="button style2 down anchored">Next</a>
</section>

<!-- Two -->
<section id="two" class="main style2 left dark fullscreen">
    <div class="content box style2">
        <header>
            <h2></h2>
        </header>
        <p>如需订购请联系我们</p>
    </div>
    <a href="#work" class="button style2 down anchored">Next</a>
</section>

<!-- Work -->
<section id="work" class="main style3 primary">
    <div class="content container">
        <header>
            <h2>我们的更多产品</h2>
            <p>我们的更多产品</p>
        </header>

        <!--
             Lightbox Gallery

             Powered by poptrox. Full docs here: https://github.com/n33/jquery.poptrox
        -->
        <div class="container small gallery">
            <div class="row flush images">
                <div class="6u"><a href="/images/yanbing/mojiegou/m9.jpg" class="image full l"><img src="/images/yanbing/mojiegou/m9.jpg" title="充电桩车棚" alt="" /></a></div>
                <div class="6u"><a href="/images/yanbing/mojiegou/m4.jpg" class="image full r"><img src="/images/yanbing/mojiegou/m4.jpg" title="学校自行车棚" alt="" /></a></div>
            </div>
            <div class="row flush images">
                <div class="6u"><a href="/images/yanbing/mojiegou/xiyanting.jpg" class="image full l"><img src="/images/yanbing/mojiegou/xiyanting.jpg" title="吸烟亭" alt="" /></a></div>
                <div class="6u"><a href="/images/yanbing/mojiegou/m6.jpg" class="image full r"><img src="/images/yanbing/mojiegou/m6.jpg" title="广场景观遮阳" alt="" /></a></div>
            </div>
            <div class="row flush images">
                <div class="6u"><a href="/images/yanbing/mojiegou/m7.jpg" class="image full l"><img src="/images/yanbing/mojiegou/m7.jpg" title="室外餐厅" alt="" /></a></div>
                <div class="6u"><a href="/images/yanbing/mojiegou/m8.jpg" class="image full r"><img src="/images/yanbing/mojiegou/m8.jpg" title="咖啡厅" alt="" /></a></div>
            </div>
        </div>

    </div>
</section>

<!-- Contact -->
<section id="contact" class="main style3 secondary">
    <div class="content container">
        <header>
            <h2>请留下您的需求</h2>
            <p>如您需要定制或者有任何建议，请给我们留言，我们将在第一时间认真阅读您的信息</p>
        </header>
        <div class="box container small">
            <form method="post" action="#" id="contact-form">
                <input name="_csrf-frontend" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
                <div class="row half">
                    <div class="6u">
                        <input id="username" type="text" name="Contact[username]" placeholder="姓名" />
                        <span style="color: red"></span>
                    </div>
                    <div class="6u">
                        <input id="phone" type="text" name="Contact[phone]" placeholder="电话" />
                        <span style="color: red"></span>
                    </div>
                </div>
                <div class="row half">
                    <div class="12u">
                        <textarea id="content" name="Contact[content]" placeholder="您的需求" rows="6"></textarea>
                        <span style="color: red"></span>
                    </div>
                </div>
                <div class="row">
                    <div class="12u">
                        <ul class="actions">
                            <li><input id="savecontact" type="button" class="button" value="提交信息" /></li>
                        </ul>
                    </div>
                </div>
            </form>

        </div>
    </div>
</section>
<script type="text/javascript">
    _settings.fadeInSpeed = 1000;
    $(function () {
        $("#savecontact").click(function () {
            $.ajax({
                url:"/site/ajax-save-contact.html",
                type:"post",
                data:$("#contact-form").serialize(),
                success:function (result) {
                    if( result.ret == false ){
                        $.each(result.error,function (k,v) {
                            var _id = "#"+k;
                            $(_id).css("border","solid 2px red");
                            $(_id).next("span").html(v);
                        });
                    }else{
                        $("#content").next("span").css("color","green").html("感谢您的留言，信息已提交成功，我们会尽快与您联系");
                        $("#savecontact").val("提交成功").attr("disabled",true);
                    }
                }
            });
        });

        $("#username").focus(function () {
            $(this).removeAttr("style").next("span").html("");
        });
        $("#phone").focus(function () {
            $(this).removeAttr("style").next("span").html("");
        });
        $("#content").focus(function () {
            $(this).removeAttr("style").next("span").html("");
        });
    });
</script>
